﻿namespace Authentication.Data.DBConfig
{
    using Authentication.Configuration;
    using Authentication.Model.Model;
    using Common.Data.Extensions;
    using System.Data.Entity.ModelConfiguration;

    public class DictionaryConfiguration : DBConfig<Dictionary>
    {
        public DictionaryConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.ApplicationKey, k.Key });
            Property(c => c.ApplicationKey).HasMaxLength(36).IsRequired();
            Property(c => c.Key).HasMaxLength(128).IsRequired();
            Property(c => c.Value).HasMaxLength(256);
            Property(c => c.CreationDate).IsRequired();
        }
    }
}